package com.xu.fountain.Entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "fountain_agent", schema = "fountain", catalog = "")
public class FountainAgentEntity {
    private int id;
    private String username;
    private String password;
    private String phone;
    private Integer cardnumber;
    private String openingbank;
    private String bankname;
    private String balance;
    private String type;
    private String token;
    private Timestamp addtime;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "cardnumber")
    public Integer getCardnumber() {
        return cardnumber;
    }

    public void setCardnumber(Integer cardnumber) {
        this.cardnumber = cardnumber;
    }

    @Basic
    @Column(name = "openingbank")
    public String getOpeningbank() {
        return openingbank;
    }

    public void setOpeningbank(String openingbank) {
        this.openingbank = openingbank;
    }

    @Basic
    @Column(name = "bankname")
    public String getBankname() {
        return bankname;
    }

    public void setBankname(String bankname) {
        this.bankname = bankname;
    }

    @Basic
    @Column(name = "balance")
    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "token")
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Basic
    @Column(name = "addtime")
    public Timestamp getAddtime() {
        return addtime;
    }

    public void setAddtime(Timestamp addtime) {
        this.addtime = addtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FountainAgentEntity that = (FountainAgentEntity) o;
        return id == that.id &&
                Objects.equals(username, that.username) &&
                Objects.equals(password, that.password) &&
                Objects.equals(phone, that.phone) &&
                Objects.equals(cardnumber, that.cardnumber) &&
                Objects.equals(openingbank, that.openingbank) &&
                Objects.equals(bankname, that.bankname) &&
                Objects.equals(balance, that.balance) &&
                Objects.equals(type, that.type) &&
                Objects.equals(token, that.token) &&
                Objects.equals(addtime, that.addtime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, username, password, phone, cardnumber, openingbank, bankname, balance, type, token, addtime);
    }
}
